      Subroutine Open_File(Jchan,Flnam,Status,Istat,Form,Crlf)

!.... Subroutine To Unify The Open Statements On Different
!.... Computer Systems
!.... Ichan: Unit Number (Integer)
!.... Flnam: File Name With No Period Nor Intervening Space
!.... Status: Character
!.... Istat: Iostat (Integer)
!.... Form: Formatted Or Not (Character)
!.... Crlf: Carriagecontrol (Character) Vax/Vms Only

    
      Implicit None
      Integer Ichan,Istat,Jchan
      Character*(*) Flnam,Status,Crlf,Form
      Integer I,Iend
      Logical CharacterComparison
      External CharacterComparison
      Character Temp*1,Ucase*26,Ttemp*100,Digit*10
      Save
      Data Ucase/'ABCDEFGHIJKLMNOPQRSTUVWXYZ'/
      Data Digit/'0123456789'/
!.... Checking
      Ichan=Abs(Jchan)
      Iend=Len_Trim(Flnam)
      
      If (Iend.Eq.0) Then
         Print *,'File Name Must Be Supplied'
         Call Termination('Open_File: No File Name')
		 
      Else If (.Not.CharacterComparison(Status,'Scratch')) Then   ! Status/='Scratch' 
         Do I=1,Iend
            Temp=Flnam(I:I)
            Call Character_Uppercase(Temp)
            If (Index(Ucase,Temp)+Index(Digit,Temp).Eq.0) Then
               Print *,'File Name Must Consist Of Alphabets Only'
               Print *,'Iend:',Iend
               Print *,'Temp,I:',Temp,I
               Print *,Flnam
               Call Termination('Open_File: Illegal Character In File Name')
            End If
         End Do

         Open(Unit=Ichan,Status=Status,File=Flnam,Iostat=Istat,Err=3100,Form=Form)            

      Else

         Open(Unit=Ichan,Status=Status,Form=Form,Iostat=Istat,Err=3100)            
      
      End If
      
      Rewind Ichan
      Ttemp=' '
      Inquire(Unit=Ichan,Name=Ttemp,Err=3200,Iostat=Istat)
	  
  111 Format(1x,A,I3,A,I3,2a)
      Return
 3100 Continue
         Print *,'Error When Opening File:',Flnam
         Call Termination('Open_File-3: Error When Opening File')
      Call Termination( 'Stopped In Open_File-3')
 3200 Continue
         Print *,'Error When Inquiring Filename'
         Call Termination('Open_File-4: Error When Inquiring Filename')
      Call Termination( 'Stopped In Open_File-4')
	  
      End

